"""
__author__ = '霍格沃兹测试开发学社'
__desc__ = '更多测试开发技术探讨，请访问：https://ceshiren.com/t/topic/15860'
"""
from backstage_management.api.base_api import BaseApi


class Order(BaseApi):
    def submit(self, cart_id):
        path = "wx/order/submit"
        order_data = {"addressId": "2",
                      "cartId": cart_id,
                      "couponId": "-1",
                      "userCouponId": "-1",
                      "grouponLinkId": 0,
                      "grouponRulesId": 0,
                      "message": ""}
        r = self.send("post", path, json=order_data)
        return r

    def list(self):
        path = "/wx/order/list"
        r = self.send("get", path)
        return r

